#ifndef EVENT_H
#define EVENT_H

#include "object.h"

typedef struct _EventInfo
{
	hObject obj1, obj2;
	int event_type;
	int time_interval;
	int param1;
	int param2;
}EventInfo, *pEventInfo;

//note that priority level 9 and 10 are not recommended
#define EVT_MAX_PRIORITY 10
#define EVT_NORMAL_PRIORITY 5
#define EVT_MIN_PRIORITY 1

typedef void (*HandlingProc)(pEventInfo);

//predefined event types
extern int evt_respawn_id;

#ifdef __cplusplus
extern "C"
{
#endif

void eventInit();
void executeEvent(pEventInfo info);
void addEvent(pEventInfo e, int priority);
int findEvent(pEventInfo e_info);
void removeEvent(pEventInfo e);
void executeTimerEvents();
int registerEventType(HandlingProc proc);

#ifdef __cplusplus
}
#endif

#endif
